<%@ page contentType="text/html; charset=UTF-8" language="java" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/jsp/common/taglibs.jsp" %>
<c:set var="SHOW_VIEW" value="${(STATE == 1) || (STATE == 3) ? '' : 'none' }" />
<c:set var="SHOW_EDIT" value="${(STATE == 2) || (STATE == 4) ? '' : 'none' }" />
<c:set var="IS_ENABLED" value="${(STATE == 1) || (STATE == 3) ? false : true }" />

<script>
$(function() {
	$( "#radioBtn" ).buttonset();
	
	if(${!IS_ENABLED}){
		$("#FORMTYPE_RESEARCH :checkbox").prop("disabled",true);
		$("#FORMTYPE_RESEARCH input").prop("disabled",true);
		$("#FORMTYPE_RESEARCH textarea").prop("disabled",true);
	}
	var _isBasicFormPriority = $("#PageForm input[name=basicFormPriority]").val();	
	
	//_isBasicFormPriority : 基本表單優先
	//thisFormType : 本頁表單
	if(${AgricultureAndFoodForm.flow == 2 } && $("#thisFormType").val() == 2){	
		$("#FORMTYPE_RESEARCH").show();
		$("label").each(function(){
			if($(this).attr("for") == 'form_2'){
				$(this).trigger('click');
			}
		});	
	}
});

function chgType(n){	
	if(n == 1){
		$("#FORMTYPE_BASIC").show();
		$("#FORMTYPE_RESEARCH").hide();
		$("#thisFormType").val("1");
	}else if(n == 2){
		$("#FORMTYPE_BASIC").hide();
		$("#FORMTYPE_RESEARCH").show();
		$("#thisFormType").val("2");
	}
}

function showLiteratureDesc(obj){
	if(obj.value == 4){
		$("#AgricultureAndFoodForm input[name=literature_desc]").show();
	}else{
		$("#AgricultureAndFoodForm input[name=literature_desc]").hide();
	}
	
}

</script>


<c:if test="${STATE != 4}">	
	<table style="width:800px;">	
		<tr>
			<td height="50px">
				<c:if test="${AgricultureAndFoodForm.flow == 2 }" >				
					<div id="radioBtn" style="margin-top: 2em;font-size: 10px;"> 
						<input type="radio" id="form_1" name="form_type" checked="checked" onclick="chgType(1);"/><label for="form_1">基本表單</label>
						<input type="radio" id="form_2" name="form_type" /><label for="form_2" onclick="chgType(2);">析研表單</label> 
					</div> 
				</c:if>				
			</td>
			<td colspan="1" style="text-align: right;padding-right:10px;vertical-align: bottom;">
				<a href="javascript:void(0);" onclick="backlist();">
					<img src="${appPath }/resource/image/arror-l.png" border="0"/>
					<img src="${appPath }/resource/image/arror-l.png" border="0"/>
					<span style="color:blue">返回清單</span>
				</a>			
				<c:if test="${STATE != 3}">			
					<span style="display:${SHOW_VIEW };" class="showField">
						<span style="color:black;padding-right:5px;padding-left:5px;">|</span>
						<a href="javascript:void(0);" onclick="view('${AgricultureAndFoodForm.seq_no }',2);" >
							<img src="${appPath }/resource/image/1322107073_pencil.png" border="0" style="vertical-align: middle"/>
						</a>
					</span>			
				</c:if>				
				<span style="display:${SHOW_EDIT };" class="editField">
					<span style="color:black;padding-right:5px;padding-left:5px;">|</span>
					<a href="javascript:void(0);" onclick="view('${AgricultureAndFoodForm.seq_no }',1);" >
						<img src="${appPath }/resource/image/1322107112_eye_inv.png" border="0" style="vertical-align: middle"/>
					</a>
				</span>
			</td> 			
		</tr>
	</table>
</c:if>

<form:form method="post" modelAttribute="AgricultureAndFoodForm" >
	<c:if test="${AgricultureAndFoodForm.flow == 2 }" >		
		<table style="width:800px;border:1px solid #D2D9E7;display:none;" id="FORMTYPE_RESEARCH">					
			<tr class="trHeader">
				<td style="padding-left:20px;" colspan="2">
					資料編號：
					<span style="color:green;font-weight:600;letter-spacing: 4px;">
						${AgricultureAndFoodForm.rec_no}
					</span>
				</td> 
			</tr>
			
			<tr class="trContent item_1">
				<td style="text-align: right;padding-right:15px;" rowspan="6">
					<%--<img src="${appPath }/resource/image/1319013350_star_red.png" width="14" height="14" title="欄位必填"/>		--%>		
					植物的基本資料
				</td> 
				<td style="padding-left: 10px;letter-spacing: 2px;">
					<form:checkbox path="researchAndAnalysis.item_1_1" label="&nbsp;外源基因" onclick="showDesc(this);"/>
					<span style="padding-left:20px;">
						<input type="text" style="width:300px;" value="${AgricultureAndFoodForm.researchAndAnalysis.item_1_1_desc }" 
							<c:if test="${!(IS_ENABLED && AgricultureAndFoodForm.researchAndAnalysis.item_1_1)}">
								disabled="true"
							</c:if>
						/>
					</span>
				</td> 
			</tr>
			<tr class="trContent item_1">
				<td style="padding-left: 10px;letter-spacing: 2px;">
					<form:checkbox path="researchAndAnalysis.item_1_2" label="&nbsp;轉殖特性" onclick="unchkSub(this.name);"/>
					<div style="padding-left: 40px;" id="sub_item_1_2">
						<form:checkbox path="researchAndAnalysis.item_1_2_1" label="&nbsp;耐除草劑" onclick="chkParent(this,'item_1_2');"/><br/>
						<form:checkbox path="researchAndAnalysis.item_1_2_2" label="&nbsp;抗蟲" onclick="chkParent(this,'item_1_2');"/><br/>
						<form:checkbox path="researchAndAnalysis.item_1_2_3" label="&nbsp;抗病毒" onclick="chkParent(this,'item_1_2');"/><br/>
						<form:checkbox path="researchAndAnalysis.item_1_2_4" label="&nbsp;抗真菌" onclick="chkParent(this,'item_1_2');"/><br/>
						<form:checkbox path="researchAndAnalysis.item_1_2_5" label="&nbsp;抗細菌" onclick="chkParent(this,'item_1_2');"/><br/>
						<form:checkbox path="researchAndAnalysis.item_1_2_6" label="&nbsp;成分改良/新增" onclick="chkParent(this,'item_1_2');"/><br/>
						<form:checkbox path="researchAndAnalysis.item_1_2_7" label="&nbsp;延熟保鮮" onclick="chkParent(this,'item_1_2');"/><br/>
						<form:checkbox path="researchAndAnalysis.item_1_2_8" label="&nbsp;其他" onclick="showDesc(this);chkParent(this,'item_1_2');"/>
						<span style="padding-left:20px;">
							<%-- <form:input path="researchAndAnalysis.item_1_2_8_desc" cssStyle="width:300px;" disabled="true" />  --%>							
							<input type="text" style="width:300px;" value="${AgricultureAndFoodForm.researchAndAnalysis.item_1_2_8_desc }" 
								<c:if test="${!(IS_ENABLED && AgricultureAndFoodForm.researchAndAnalysis.item_1_2_8)}">
									disabled="true"
								</c:if>
							/>							
						</span>
					</div>
				</td> 
			</tr>
			<tr class="trContent item_1">
				<td style="padding-left: 10px;letter-spacing: 2px;">
					<form:checkbox path="researchAndAnalysis.item_1_3" label="&nbsp;載體　　　" onclick="showDesc(this);"/>
					<span style="padding-left:20px;">
						<input type="text" style="width:300px;" value="${AgricultureAndFoodForm.researchAndAnalysis.item_1_3_desc }" 
							<c:if test="${!(IS_ENABLED && AgricultureAndFoodForm.researchAndAnalysis.item_1_3)}">
								disabled="true"
							</c:if>
						/>
					</span>
				</td> 
			</tr>
			<tr class="trContent item_1">
				<td style="padding-left: 10px;letter-spacing: 2px;">
					<form:checkbox path="researchAndAnalysis.item_1_4" label="&nbsp;篩選用基因" onclick="showDesc(this);"/>
					<span style="padding-left:20px;">
						<input type="text" style="width:300px;" value="${AgricultureAndFoodForm.researchAndAnalysis.item_1_4_desc }" 
							<c:if test="${!(IS_ENABLED && AgricultureAndFoodForm.researchAndAnalysis.item_1_4)}">
								disabled="true"
							</c:if>
						/>
					</span>
				</td> 
			</tr>
			<tr class="trContent item_1">
				<td style="padding-left: 10px;letter-spacing: 2px;">
					<form:checkbox path="researchAndAnalysis.item_1_5" label="&nbsp;其他　　　" onclick="showDesc(this);"/>
					<span style="padding-left:20px;">
						<input type="text" style="width:300px;" value="${AgricultureAndFoodForm.researchAndAnalysis.item_1_5_desc }" 
							<c:if test="${!(IS_ENABLED && AgricultureAndFoodForm.researchAndAnalysis.item_1_5)}">
								disabled="true"
							</c:if>
						/>
					</span>
				</td> 
			</tr>
			<tr class="trContent">
				<td style="padding-left: 10px;letter-spacing: 2px;">
					<form:checkbox path="researchAndAnalysis.item_1_6" label="&nbsp;以上皆無　" onclick="showDesc(this);noneOfAbove(this,'item_1');"/>
					<span style="padding-left:20px;">
						<input type="text" style="width:300px;" value="${AgricultureAndFoodForm.researchAndAnalysis.item_1_6_desc }" 
							<c:if test="${!(IS_ENABLED && AgricultureAndFoodForm.researchAndAnalysis.item_1_6)}">
								disabled="true"
							</c:if>
						/>
					</span>
				</td> 
			</tr>
			
			<tr class="trContent">
				<td style="text-align: right;padding-right:15px;">	
					疑慮項目
				</td> 
				<td style="padding-left: 10px;letter-spacing: 2px;">
					<form:checkbox path="researchAndAnalysis.item_2_1" label="&nbsp;基轉植物與近緣植物、野生種或同種雜交之可能性"/><br/>
					<form:checkbox path="researchAndAnalysis.item_2_2" label="&nbsp;基轉植物演變成雜草(super weed)的可能性及影響"/><br/>
					<form:checkbox path="researchAndAnalysis.item_2_3" label="&nbsp;基轉植物對目標生物可能之直(間)接影響"/><br/>
					<form:checkbox path="researchAndAnalysis.item_2_4" label="&nbsp;基轉植物對非目標生物可能之直(間)接影響"/><br/>
					<form:checkbox path="researchAndAnalysis.item_2_5" label="&nbsp;基轉植物所含外源基因流入其他動植物、病原生物可能性及影響"/><br/>
					<form:checkbox path="researchAndAnalysis.item_2_6" label="&nbsp;基轉植物發生基因外流(gene flow)對生態環境及原生種可能之影響"/><br/>
					<form:checkbox path="researchAndAnalysis.item_2_7" label="&nbsp;基轉植物對田間土壤微生物相之影響及毒性釋出等可能性"/><br/>			
					<form:checkbox path="researchAndAnalysis.item_2_8" label="&nbsp;其他" onclick="showDesc(this);"/>
					<span style="padding-left:20px;">
						<input type="text" style="width:300px;" value="${AgricultureAndFoodForm.researchAndAnalysis.item_2_8_desc }" 
							<c:if test="${!(IS_ENABLED && AgricultureAndFoodForm.researchAndAnalysis.item_2_8)}">
								disabled="true"
							</c:if>
						/>
					</span>
				</td> 
			</tr>
			
			<tr class="trContent item_3">
				<td style="text-align: right;padding-right:15px;" rowspan="4">	
					管理方法
				</td> 
				<td style="padding-left: 10px;letter-spacing: 2px;">
					<form:checkbox path="researchAndAnalysis.item_3_1" label="&nbsp;相關法令規章" onclick="unchkSub(this.name);"/>
					<div style="padding-left: 40px;" id="sub_item_3_1">
						<form:checkbox path="researchAndAnalysis.item_3_1_1" label="&nbsp;申請案的基本資訊" onclick="chkParent(this,'item_3_1');"/><br/>
						<form:checkbox path="researchAndAnalysis.item_3_1_2" label="&nbsp;材料之性狀穩定程度" onclick="chkParent(this,'item_3_1');"/><br/>
						<form:checkbox path="researchAndAnalysis.item_3_1_3" label="&nbsp;研發時的必要記錄" onclick="chkParent(this,'item_3_1');"/><br/>
						<form:checkbox path="researchAndAnalysis.item_3_1_4" label="&nbsp;溫室及隔離田所作業之數據" onclick="chkParent(this,'item_3_1');"/><br/>
						<form:checkbox path="researchAndAnalysis.item_3_1_5" label="&nbsp;根據評估決策所需之實驗設計或統計" onclick="chkParent(this,'item_3_1');"/><br/>
						<form:checkbox path="researchAndAnalysis.item_3_1_6" label="&nbsp;其它管理制度" onclick="chkParent(this,'item_3_1');"/>
					</div>
				</td>
			</tr>
			<tr class="trContent item_3">
				<td style="padding-left: 10px;letter-spacing: 2px;">
					<form:checkbox path="researchAndAnalysis.item_3_2" label="&nbsp;要求相關設施" onclick="unchkSub(this.name);"/>
					<div style="padding-left: 40px;" id="sub_item_3_2">
						<form:checkbox path="researchAndAnalysis.item_3_2_1" label="&nbsp;設施要求" onclick="chkParent(this,'item_3_2');"/><br/>
						<form:checkbox path="researchAndAnalysis.item_3_2_2" label="&nbsp;距離區隔" onclick="chkParent(this,'item_3_2');"/><br/>
						<form:checkbox path="researchAndAnalysis.item_3_2_3" label="&nbsp;材料特性 (如密閉型溫室、植物培養裝置、密閉型實驗室 )" onclick="chkParent(this,'item_3_2');"/>
					</div>
				</td> 
			</tr>
			<tr class="trContent item_3">
				<td style="padding-left: 10px;letter-spacing: 2px;">
					<form:checkbox path="researchAndAnalysis.item_3_3" label="&nbsp;相關風險評估" onclick="unchkSub(this.name);"/>
					<div style="padding-left: 40px;" id="sub_item_3_3">
						<form:checkbox path="researchAndAnalysis.item_3_3_1" label="&nbsp;發生機率計算 (高、中、低、極低或是其他程度分類)" onclick="chkParent(this,'item_3_3');"/><br/>
						<form:checkbox path="researchAndAnalysis.item_3_3_2" label="&nbsp;危害程度計算 (高、中、低、極低或是其他程度分類)" onclick="chkParent(this,'item_3_3');"/><br/>
						<form:checkbox path="researchAndAnalysis.item_3_3_3" label="&nbsp;產生方式 (例如花粉、昆蟲、農事作業等 )" onclick="chkParent(this,'item_3_3');"/><br/>
						<form:checkbox path="researchAndAnalysis.item_3_3_4" label="&nbsp;評估方法或實驗設計" onclick="chkParent(this,'item_3_3');"/><br/>
						<form:checkbox path="researchAndAnalysis.item_3_3_5" label="&nbsp;影響因子" onclick="chkParent(this,'item_3_3');"/>
					</div>
				</td> 
			</tr>
			<tr class="trContent">
				<td style="padding-left: 10px;letter-spacing: 2px;">
					<form:checkbox path="researchAndAnalysis.item_3_4" label="&nbsp;以上皆無" onclick="noneOfAbove(this,'item_3');"/>
				</td> 
			</tr>
			<tr class="trContent">
				<td style="text-align: right;padding-right:15px;">	
					管理工具
				</td> 
				<td style="padding-left: 10px;letter-spacing: 2px;">
					<div class="item_4">
						<form:checkbox path="researchAndAnalysis.item_4_1" label="&nbsp;風險評估試驗規範 (法規)"/><br/>
						<form:checkbox path="researchAndAnalysis.item_4_2" label="&nbsp;評估報告範本"/><br/>
						<form:checkbox path="researchAndAnalysis.item_4_3" label="&nbsp;審查標準設計 (操作細則)"/><br/>
						<form:checkbox path="researchAndAnalysis.item_4_4" label="&nbsp;風險評估分析方法 (實驗設計)"/><br/>
						<form:checkbox path="researchAndAnalysis.item_4_5" label="&nbsp;管理流程 (或分類架構)"/><br/>
						<form:checkbox path="researchAndAnalysis.item_4_6" label="&nbsp;其他 (相關政策)" onclick="showDesc(this);"/>				
						<span style="padding-left:20px;">
							<input type="text" style="width:300px;" value="${AgricultureAndFoodForm.researchAndAnalysis.item_4_6_desc }" 
							<c:if test="${!(IS_ENABLED && AgricultureAndFoodForm.researchAndAnalysis.item_4_6)}">
								disabled="true"
							</c:if>
						/>
						</span>
					</div>
					<form:checkbox path="researchAndAnalysis.item_4_7" label="&nbsp;皆無" onclick="noneOfAbove(this,'item_4');"/>
				</td>
			</tr>		
			<tr class="trContent">
				<td style="text-align: right;padding-right:15px;">	
					重點/感想
				</td> 
				<td style="padding-left: 10px;letter-spacing: 2px;">				
					<form:textarea path="researchAndAnalysis.item_5_desc" rows="4" cssStyle="width:95%"/>
				</td> 
			</tr>
		</table>
	</c:if>
	
	<table style="width:800px;border:1px solid #D2D9E7;" id="FORMTYPE_BASIC">	
		<tr class="trHeader">
			<td style="padding-left:20px;" colspan="2">
				資料編號：
				<span style="color:green;font-weight:600;letter-spacing: 4px;">
					${AgricultureAndFoodForm.rec_no}
				</span>
			</td> 
		</tr>
		<tr class="trContent">
			<td style="width:20%;text-align: right;padding-right:15px;">
				<img src="${appPath }/resource/image/1319013350_star_red.png" width="14" height="14" title="欄位必填"/>
				原文標題
			</td> 
			<td style="padding-left: 10px;">
				<form:textarea path="title_o" cssClass="bar_1 editField" cssStyle="width:600px;display:${SHOW_EDIT };" rows="5" onblur="comparison();" validate="required"/>
				<span id="show_title_o" class="showField" style="display:${SHOW_VIEW };">
					${AgricultureAndFoodForm.title_o == '' ? '&nbsp;' : AgricultureAndFoodForm.title_o}
				</span>
			</td> 
		</tr>
		<!--  
		<tr class="trContent">
			<td style="text-align: right;padding-right:15px;">中譯標題</td> 
			<td style="padding-left: 10px;">
				<form:textarea path="title_c" cssClass="bar_1 editField" cssStyle="width:600px;display:${SHOW_EDIT };" rows="5"/>
				<span id="show_title_c" class="showField" style="display:${SHOW_VIEW };">
					${AgricultureAndFoodForm.title_c == '' ? '&nbsp;' : AgricultureAndFoodForm.title_c}
				</span>
			</td> 
		</tr>
		-->
		<tr class="trContent">
			<td style="text-align: right;padding-right:15px;">
				<img src="${appPath }/resource/image/1319013350_star_red.png" width="14" height="14" title="欄位必填"/>
				作者
			</td> 
			<td style="padding-left: 10px;">
				<form:textarea path="author" cssClass="bar_1 editField" cssStyle="width:600px;display:${SHOW_EDIT };" onblur="comparison();" rows="5" validate="required"/>
				<span id="show_author" class="showField" style="display:${SHOW_VIEW };">
					${AgricultureAndFoodForm.author == '' ? '&nbsp;' : AgricultureAndFoodForm.author}
				</span>
			</td> 
		</tr>
		<tr class="trContent">
			<td style="text-align: right;padding-right:15px;">作者服務機構</td> 
			<td style="padding-left: 10px;">
				<form:textarea path="affiliation" cssClass="bar_1 editField" cssStyle="width:600px;display:${SHOW_EDIT };" rows="5"/>
				<span id="show_affiliation" class="showField" style="display:${SHOW_VIEW };">
					${AgricultureAndFoodForm.affiliation == '' ? '&nbsp;' : AgricultureAndFoodForm.affiliation}
				</span>
			</td> 
		</tr>
		
		<tr class="trContent">
			<td style="text-align: right;padding-right:15px;">出版機構</td> 
			<td style="padding-left: 10px;">
				<form:textarea path="publisher" cssClass="bar_1 editField" cssStyle="width:600px;display:${SHOW_EDIT };" rows="5"/>
				<span id="show_publisher" class="showField" style="display:${SHOW_VIEW };">
					${AgricultureAndFoodForm.publisher == '' ? '&nbsp;' : AgricultureAndFoodForm.publisher}
				</span>
			</td> 
		</tr>
		
		<tr class="trContent">
			<td style="text-align: right;padding-right:15px;">期刊名稱</td> 
			<td style="padding-left: 10px;">
				<form:textarea path="journal" cssClass="bar_1 editField" cssStyle="width:600px;display:${SHOW_EDIT };" rows="5"/>
				<span id="show_journal" class="showField" style="display:${SHOW_VIEW };">
					${AgricultureAndFoodForm.journal == '' ? '&nbsp;' : AgricultureAndFoodForm.journal}
				</span>
			</td> 
		</tr>
		<tr class="trContent">
			<td style="text-align: right;padding-right:15px;">卷期頁碼</td> 
			<td style="padding-left: 10px;">
				<form:input path="vol_page" cssClass="bar_1 editField" cssStyle="width:600px;display:${SHOW_EDIT };" />
				<span id="show_vol_page" class="showField" style="display:${SHOW_VIEW };">
					${AgricultureAndFoodForm.vol_page == '' ? '&nbsp;' : AgricultureAndFoodForm.vol_page}
				</span>
			</td> 
		</tr>
		
		<tr class="trContent">
			<td style="text-align: right;padding-right:15px;">
				<img src="${appPath }/resource/image/1319013350_star_red.png" width="14" height="14" title="欄位必填"/>
				出版年
			</td> 
			<td style="padding-left: 10px;">
				<form:select path="year" cssStyle="width:120px;display:${SHOW_EDIT };" cssClass="editField" validate="required">
					<form:option value="0" label="--請選擇--" />
					<form:option value="1" label="不明" />	
					<c:forEach var="year" begin="1981" end="2012" varStatus="s">
						<form:option value="${year }" label="${year }" />									
					</c:forEach>
				</form:select>
				<span id="show_year" class="showField" style="display:${SHOW_VIEW };">
					<c:choose>
						<c:when test="${AgricultureAndFoodForm.year == 0}">
							尚未選擇
						</c:when>
						<c:when test="${AgricultureAndFoodForm.year == 1}">
							年代不明
						</c:when>
						<c:otherwise>
							${AgricultureAndFoodForm.year}
						</c:otherwise>
					</c:choose>				
				</span>
			</td> 
		</tr>
			
		<tr class="trContent">
			<td style="text-align: right;padding-right:15px;">
				<img src="${appPath }/resource/image/1319013350_star_red.png" width="14" height="14" title="欄位必填"/>
				語文
			</td> 
			<td style="padding-left: 10px;">
				<form:select path="language" cssStyle="width:120px;display:${SHOW_EDIT };" cssClass="editField" validate="required">
					<form:option value="0" label="--請選擇--" />
					<%--
					<c:forEach var="lang" items="${CodeLanguage}">
						<form:option value="${lang.code }" label="${lang.name }" />									
					</c:forEach>
					--%>
					<form:options items="${CodeLanguage}" itemValue="code" itemLabel="name"/>
				</form:select>
				<span id="show_language" class="showField" style="display:${SHOW_VIEW };">					
					<c:choose>
						<c:when test="${AgricultureAndFoodForm.codeLanguage.name == null}">
							尚未選擇
						</c:when>
						<c:otherwise>
							${AgricultureAndFoodForm.codeLanguage.name}
						</c:otherwise>
					</c:choose>
				</span>
			</td> 
		</tr>
		
		<tr class="trContent">
			<td style="text-align: right;padding-right:15px;">
				<img src="${appPath }/resource/image/1319013350_star_red.png" width="14" height="14" title="欄位必填"/>
				資料類型
			</td> 
			<td style="padding-left: 10px;">
				<form:select path="doc_type" cssStyle="width:200px;display:${SHOW_EDIT };" cssClass="editField" validate="required">
					<form:option value="0" label="--請選擇--" />
					<form:option value="1" label="1) 期刊論文" />
					<form:option value="2" label="2) 圖書/圖書章節" />
					<form:option value="3" label="3) 報告" />
					<form:option value="4" label="4) 會議論文/會議論文集" />
					<form:option value="5" label="5) 學位論文" />
					<form:option value="6" label="6) 手冊/教材" />
				</form:select>
				<span id="show_doc_type" class="showField" style="display:${SHOW_VIEW };">
					<c:if test="${AgricultureAndFoodForm.doc_type == 0}" >
						尚未選擇
					</c:if>
					<c:if test="${AgricultureAndFoodForm.doc_type == 1}" >
						1) 期刊論文
					</c:if>
					<c:if test="${AgricultureAndFoodForm.doc_type == 2}" >
						2) 圖書/圖書章節
					</c:if>
					<c:if test="${AgricultureAndFoodForm.doc_type == 3}" >
						3) 報告
					</c:if>
					<c:if test="${AgricultureAndFoodForm.doc_type == 4}" >
						4) 會議論文/會議論文集
					</c:if>
					<c:if test="${AgricultureAndFoodForm.doc_type == 5}" >
						5) 學位論文
					</c:if>
					<c:if test="${AgricultureAndFoodForm.doc_type == 6}" >
						6) 手冊/教材
					</c:if>
				</span>
			</td> 
		</tr>
		
		
		<!-- 2011/11/23 新增 --------------------------------------------------------------------------------->
		
		<tr class="trContent">
			<td style="text-align: right;padding-right:15px;">
				文獻性質<br/>
			</td> 
			<td style="padding-left: 10px;">				
				<form:select path="literature" cssStyle="width:120px;display:${SHOW_EDIT };" cssClass="editField" onchange="showLiteratureDesc(this);">
					<form:option value="0" label="--請選擇--" />
		 			<form:option value="1" label="original paper" />
		 			<form:option value="2" label="review" />
		 			<form:option value="3" label="disscussion" />
		 			<form:option value="4" label="其他" />
		 		</form:select>
	 			<span style="padding-left:10px;">
	 				<form:input path="literature_desc" cssStyle="width:350px;display:${AgricultureAndFoodForm.literature == 4 ? '' : 'none'};" cssClass="editField"/>
	 			</span>

				<span id="show_literature" class="showField" style="display:${SHOW_VIEW };">						
					<c:if test="${AgricultureAndFoodForm.literature == 1}">
						<div>original paper</div>
					</c:if>
					<c:if test="${AgricultureAndFoodForm.literature == 2}">
						<div>review</div>
					</c:if>
					<c:if test="${AgricultureAndFoodForm.literature == 3}">
						<div>disscussion</div>
					</c:if>
					<c:if test="${AgricultureAndFoodForm.literature == 4}">
						<div>其他 : ${AgricultureAndFoodForm.literature_desc }</div>
					</c:if>
				</span>
			</td> 
		</tr>	
		<!-- --------------------------------------------------------------------------------------- -->
		
		<tr class="trContent">
			<td style="text-align: right;padding-right:15px;">原文摘要</td> 
			<td style="padding-left: 10px;">
				<form:textarea path="abstract_o" cssClass="bar_1 editField" cssStyle="width:600px;display:${SHOW_EDIT };" rows="5"/>
				<span id="show_abstract_o" class="showField" style="display:${SHOW_VIEW };">
					${AgricultureAndFoodForm.abstract_o == '' ? '&nbsp;' : AgricultureAndFoodForm.abstract_o}
				</span>
			</td> 
		</tr>
		<!--
		<tr class="trContent">
			<td style="text-align: right;padding-right:15px;">中譯摘要</td> 
			<td style="padding-left: 10px;">
				<form:textarea path="abstract_c" cssClass="bar_1 editField" cssStyle="width:600px;display:${SHOW_EDIT };" rows="5"/>
				<span id="show_abstract_c" class="showField" style="display:${SHOW_VIEW };">
					${AgricultureAndFoodForm.abstract_c == '' ? '&nbsp;' : AgricultureAndFoodForm.abstract_c}
				</span>
			</td> 
		</tr>
		-->
		<tr class="trContent">
			<td style="text-align: right;padding-right:15px;">關鍵詞</td> 
			<td style="padding-left: 10px;">
				<form:textarea path="keyword_o" cssClass="bar_1 editField" cssStyle="width:600px;display:${SHOW_EDIT };" rows="5"/>
				<span id="show_keyword_o" class="showField" style="display:${SHOW_VIEW };">
					${AgricultureAndFoodForm.keyword_o == '' ? '&nbsp;' : AgricultureAndFoodForm.keyword_o}
				</span>
			</td> 
		</tr>
		
		<!--  
		<tr class="trContent">
			<td style="text-align: right;padding-right:15px;">中譯關鍵詞</td> 
			<td style="padding-left: 10px;">
				<form:textarea path="keyword_c" cssClass="bar_1" cssStyle="width:600px;" rows="5"/>
			</td> 
		</tr>
		-->
		
		<tr class="trContent">
			<td style="text-align: right;padding-right:15px;">
				<img src="${appPath }/resource/image/1319014160_star_blue.png" width="14" height="14" title="欄位選填"/>
				原文網址
			</td> 
			<td style="padding-left: 10px;">
				<form:input path="url" cssClass="bar_1 editField" cssStyle="width:600px;display:${SHOW_EDIT };"/>
				<span id="show_url" class="showField" style="display:${SHOW_VIEW };">
					${AgricultureAndFoodForm.url == '' ? '&nbsp;' : AgricultureAndFoodForm.url}
				</span>
			</td> 
		</tr>		
		
		<tr class="trContent">
			<td style="text-align: right;padding-right:15px;">
				<img src="${appPath }/resource/image/1319014160_star_blue.png" width="14" height="14" title="欄位選填"/>
				原文<!--編號-->
			</td> 
			<td style="padding-left: 10px;">
				<div class="editField" style="display:${SHOW_EDIT };" id="_ofiles">
					<input type="file" name="fileData" size="50" id="fileData"/>
					&nbsp;
					<a href="javascript:void(0);" onclick="doAction();">
						<img src="${appPath }/resource/image/1318260696_Upload.png" border="0"/>
					</a>
				</div>
				<div id="upload_files_area" style="color:blue;display:${SHOW_EDIT };">								
					<c:forEach var="filesSet" items="${AgricultureAndFoodForm.filesSet }" varStatus="s">					
						<div id="files_${filesSet.seq_no}">${filesSet.original_name}&nbsp;
							<span class='editField'><a href="javascript:removefile(${filesSet.seq_no});">( 移除 )</a></span>
						</div>
					</c:forEach>
				</div>
				<div id="show_files" style="color:blue;display:${SHOW_VIEW };">					
					<c:forEach var="filesSet" items="${AgricultureAndFoodForm.filesSet }" varStatus="s">
						${filesSet.original_name}<br/>
					</c:forEach>
				</div>
			</td> 
		</tr>
		
		<tr class="trContent">
			<td style="text-align: right;padding-right:15px;">探討植物別</td> 
			<td style="padding-left: 10px;">
				<div id="span_selectedCodePlants" style="color:green;font-weight: 300;display:${SHOW_EDIT };" class="editField">					
					<c:forEach var="codePlantSet" items="${AgricultureAndFoodForm.codePlantSet }" varStatus="s">
						
						<c:choose>
							<c:when test="${s.first}">
								<span id='CP_${codePlantSet.code }'>
									${codePlantSet.name_ch }
									<a href='javascript:void(0);' onclick='removePlantCode("${codePlantSet.code }","${codePlantSet.name_ch }");'>[移除]</a>
								</span>
							</c:when>
							<c:otherwise>
								<span id='CP_${codePlantSet.code }'>、
									${codePlantSet.name_ch }
									<a href='javascript:void(0);' onclick='removePlantCode("${codePlantSet.code }","${codePlantSet.name_ch }");'>[移除]</a>
								</span>
							</c:otherwise>
						</c:choose>
						
					</c:forEach>
				</div>
				<span style="color:blue;cursor: pointer;display:${SHOW_EDIT };" onclick="getCodePlantQuery(null,true);" class="editField">
					選取植物別
					<span id="plantLoadingImg" style="display:none">
						<img src="${appPath }/resource/image/ajax-loader.gif" />
					</span>
				</span>
				
				<span id="show_plants" class="showField" style="display:${SHOW_VIEW };">
					<c:forEach var="codePlantSet" items="${AgricultureAndFoodForm.codePlantSet }" varStatus="s">
						${codePlantSet.name_ch }
						<c:if test="${!s.last }">
							、
						</c:if>
					</c:forEach>
				</span>
			</td> 
		</tr>
		
		<tr class="trContent">
			<td style="text-align: right;padding-right:15px;">探討國別</td> 
			<td style="padding-left: 10px;">
				<div id="span_selectedCodeCountries" style="color:green;font-weight: 300;display:${SHOW_EDIT };" class="editField">
					<c:forEach var="codeCountrySet" items="${AgricultureAndFoodForm.codeCountrySet }" varStatus="s">
						
						<c:choose>
							<c:when test="${s.first}">
								<span id='CC_${codeCountrySet.code }'>
									${codeCountrySet.name_ch }
									<a href='javascript:void(0);' onclick='removeCountryCode("${codeCountrySet.code }","${codeCountrySet.name_ch }");'>[移除]</a>
								</span>
							</c:when>
							<c:otherwise>
								<span id='CC_${codeCountrySet.code }'>、
									${codeCountrySet.name_ch }
									<a href='javascript:void(0);' onclick='removeCountryCode("${codeCountrySet.code }","${codeCountrySet.name_ch }");'>[移除]</a>
								</span>
							</c:otherwise>
						</c:choose>
						
						
					</c:forEach>
				</div>
				<span style="color:blue;cursor: pointer;display:${SHOW_EDIT };" onclick="getCodeCountryQuery(null,true);" class="editField">
					選取國別
					<span id="countryLoadingImg" style="display:none">
						<img src="${appPath }/resource/image/ajax-loader.gif" />
					</span>
				</span>
				<span id="show_countries" class="showField" style="display:${SHOW_VIEW };">
					<c:forEach var="codeCountrySet" items="${AgricultureAndFoodForm.codeCountrySet }" varStatus="s">
						${codeCountrySet.name_ch }
						<c:if test="${!s.last }">
							、
						</c:if>
					</c:forEach>
				</span>
			</td> 
		</tr>	
		
		<tr class="trContent">
			<td style="text-align: right;padding-right:15px;">
				<img src="${appPath }/resource/image/1319013350_star_red.png" width="14" height="14" title="欄位必填"/>
				主題分類<br/>
				
				<span style="color:red;font-weight: 300;display:${SHOW_EDIT };">(至多選三項)</span>
			</td> 
			<td style="padding-left: 10px;">
				<c:set var="clazz_count" value="${fn:length(fn:split(AgricultureAndFoodForm.clazz, ','))}" />	
				
				<c:set var="clazz_a_checked" value="${fn:indexOf(AgricultureAndFoodForm.clazz, 'A') != -1 ? 'checked' : ''}" />
				<c:set var="clazz_b_checked" value="${fn:indexOf(AgricultureAndFoodForm.clazz, 'B') != -1 ? 'checked' : ''}" />
				<c:set var="clazz_c_checked" value="${fn:indexOf(AgricultureAndFoodForm.clazz, 'C') != -1 ? 'checked' : ''}" />
				<c:set var="clazz_d_checked" value="${fn:indexOf(AgricultureAndFoodForm.clazz, 'D') != -1 ? 'checked' : ''}" />
				<c:set var="clazz_e_checked" value="${fn:indexOf(AgricultureAndFoodForm.clazz, 'E') != -1 ? 'checked' : ''}" />
				
				
				<c:set var="clazz_a_disabled" value="${clazz_count >= 3 && clazz_a_checked == '' ? 'true' : 'false' }" />
				<c:set var="clazz_b_disabled" value="${clazz_count >= 3 && clazz_b_checked == '' ? 'true' : 'false' }" />
				<c:set var="clazz_c_disabled" value="${clazz_count >= 3 && clazz_c_checked == '' ? 'true' : 'false' }" />
				<c:set var="clazz_d_disabled" value="${clazz_count >= 3 && clazz_d_checked == '' ? 'true' : 'false' }" />
				<c:set var="clazz_e_disabled" value="${clazz_count >= 3 && clazz_e_checked == '' ? 'true' : 'false' }" />
			
			
				<div class="editField" id="_clazz" style="display:${SHOW_EDIT };">
					<form:checkbox path="clazz" class="clazz" onclick="checkClazz();" value="A" v="生物安全政策與法規" label="生物安全政策與法規" disabled="${clazz_a_disabled }" checked="${clazz_a_checked }"/><br/>
					<form:checkbox path="clazz" class="clazz" onclick="checkClazz();" value="B" v="風險評估與風險管理" label="風險評估與風險管理" disabled="${clazz_b_disabled }" checked="${clazz_b_checked }"/><br/>
					<form:checkbox path="clazz" class="clazz" onclick="checkClazz();" value="C" v="社經與貿易議題" label="社經與貿易議題" disabled="${clazz_c_disabled }" checked="${clazz_c_checked }"/><br/>
					<form:checkbox path="clazz" class="clazz" onclick="checkClazz();" value="D" v="公眾認知、教育與參與" label="公眾認知、教育與參與" disabled="${clazz_d_disabled }" checked="${clazz_d_checked }"/><br/>
					<form:checkbox path="clazz" class="clazz" onclick="checkClazz();" value="E" v="其他" label="其他" disabled="${clazz_e_disabled }" checked="${clazz_e_checked }"/>
				</div>
				<span id="show_clazz" class="showField" style="display:${SHOW_VIEW };">						
					<c:if test="${fn:indexOf(AgricultureAndFoodForm.clazz, 'A') != -1}">
						<div>‧生物安全政策與法規</div>
					</c:if>
					<c:if test="${fn:indexOf(AgricultureAndFoodForm.clazz, 'B') != -1}">
						<div>‧風險評估與風險管理</div>
					</c:if>
					<c:if test="${fn:indexOf(AgricultureAndFoodForm.clazz, 'C') != -1}">
						<div>‧社經與貿易議題</div>
					</c:if>
					<c:if test="${fn:indexOf(AgricultureAndFoodForm.clazz, 'D') != -1}">
						<div>‧公眾認知、教育與參與</div>
					</c:if>
					<c:if test="${fn:indexOf(AgricultureAndFoodForm.clazz, 'E') != -1}">
						<div>‧其他</div>
					</c:if>
				</span>
			</td> 
		</tr>	
		
		<tr class="trContent">
			<td style="text-align: right;padding-right:15px;">研析資料</td> 
			<td style="padding-left: 10px;">
				<span class="editField" style="display:${SHOW_EDIT };">
					<form:radiobutton path="analyzed" class="analyzed" value="true" selected="selected"/> 有
					<form:radiobutton path="analyzed" class="analyzed" value="false"/> 無
				</span>
				<span id="show_analyzed" class="showField" style="display:${SHOW_VIEW };">${AgricultureAndFoodForm.analyzed ? '有' : '無'}</span>
			</td> 
		</tr>
		
		<c:if test="${STATE == 3 || STATE == 4}">	
			<tr class="trContent">
				<td style="text-align: right;padding-right:15px;">建立者</td> 
				<td style="padding-left: 10px;">
					${AgricultureAndFoodForm.users.fullname }
				</td> 
			</tr>
		</c:if>
		
		<tr class="trContent">
			<td style="text-align: right;padding-right:15px;">建立日期</td> 
			<td style="padding-left: 10px;">
				<span style="letter-spacing: 0px;color: blue;font-weight: 600;">
					${AgricultureAndFoodForm.created}
				</span>
			</td> 
		</tr>		
		<c:if test="${AgricultureAndFoodForm.updated != null }">
			<tr class="trContent">
				<td style="text-align: right;padding-right:15px;">更新日期</td> 
				<td style="padding-left: 10px;">
					<span style="letter-spacing: 0px;color: blue;font-weight: 600;">
						${AgricultureAndFoodForm.updated == null ? '&nbsp;' : AgricultureAndFoodForm.updated}
					</span>
				</td> 
			</tr>
		</c:if>		
		<c:if test="${AgricultureAndFoodForm.checker_user != null }">
			<tr class="trContent">
				<td style="text-align: right;padding-right:15px;">檢核者</td> 
				<td style="padding-left: 10px;">
					<span style="letter-spacing: 0px;color: blue;font-weight: 600;">
						${AgricultureAndFoodForm.checker_user.fullname}
					</span>
				</td> 
			</tr>
			<tr class="trContent">
				<td style="text-align: right;padding-right:15px;">檢核日期</td> 
				<td style="padding-left: 10px;">
					<span style="letter-spacing: 0px;color: blue;font-weight: 600;">
						${AgricultureAndFoodForm.created}
					</span>
				</td> 
			</tr>
		</c:if>
		
		<c:if test="${STATE == 4}">
			<tr class="showField" style="display:${SHOW_VIEW };">		
				<td colspan="2" style="text-align: center;height:80px;border-bottom:2px solid #D2D9E7;">
					<span class="button_1" style="width:80px;padding: 6px 10px 6px 10px;" onclick="getStatus('${AgricultureAndFoodForm.seq_no}','${AgricultureAndFoodForm.rec_no}');backlist();">
						返回清單
					</span>
				</td> 
			</tr>	
		</c:if>
		
		<!--  
		<tr class="trContent">
			<td style="text-align: right;padding-right:15px;">被引標題</td> 
			<td style="padding-left: 10px;">
				<form:textarea path="citation_title" cssClass="bar_1" cssStyle="width:600px;" rows="5"/>
			</td> 
		</tr>	
		
		<tr class="trContent">
			<td style="text-align: right;padding-right:15px;">被引作者</td> 
			<td style="padding-left: 10px;">
				<form:textarea path="citation_author" cssClass="bar_1" cssStyle="width:600px;" rows="5"/>
			</td> 
		</tr>	
		
		<tr class="trContent">
			<td style="text-align: right;padding-right:15px;">被引出處</td> 
			<td style="padding-left: 10px;">
				<form:textarea path="citation_source" cssClass="bar_1" cssStyle="width:600px;" rows="5"/>
			</td> 
		</tr>					
		-->	
		<tr class="editField" style="display:${SHOW_EDIT };background-color: #F2F2F2;">
			<td colspan="2" style="text-align: center;height:80px;">
				<span class="editField" style="display:${SHOW_EDIT };">	
					<c:if test="${STATE == 2}">						
						<c:if test="${AgricultureAndFoodForm.flow == 0}" >
							<span class="button_1" style="width:60px;padding: 6px 10px 6px 10px;" onclick="_submit(0);">暫　存</span>
						</c:if>	
						<span class="button" style="width:60px;" onclick="_submit(1);">確　認</span> 
						<span style="display:none">
							<input type="checkbox" />資料強制確認送出
						</span>		
					</c:if>
					<c:if test="${STATE == 4}">					
						<span class="button_1" style="width:60px;padding: 6px 10px 6px 10px;" onclick="cancel('${AgricultureAndFoodForm.seq_no}','${AgricultureAndFoodForm.rec_no}');">放棄檢核</span> 	
						<span class="button" style="width:60px;" onclick="_submit();">檢核完成</span> 	
					</c:if>
				</span>
			</td> 
		</tr>
	</table>
	<form:hidden path="seq_no" />
	<form:hidden path="flow" />
	<form:hidden path="plants_code" />
	<form:hidden path="plants_name_ch" />
	<form:hidden path="countries_name_ch" />
	<form:hidden path="countries_code" />
	<form:hidden path="files" />
</form:form>

<c:if test="${STATE != 4}">	
	<table style="width:800px;">	
		<tr>
			<td colspan="2" style="text-align: right;padding-right:10px;">
				<a href="javascript:void(0);" onclick="backlist();">
					<img src="${appPath }/resource/image/arror-l.png" border="0"/>
					<img src="${appPath }/resource/image/arror-l.png" border="0"/>
					<span style="color:blue">返回清單</span>
				</a>
				
				<c:if test="${STATE != 3}">	
					<span style="display:${SHOW_VIEW };" class="showField">
						<span style="color:black;padding-right:5px;padding-left:5px;">|</span>
						<a href="javascript:void(0);" onclick="view('${AgricultureAndFoodForm.seq_no }',2);" >
							<img src="${appPath }/resource/image/1322107073_pencil.png" border="0" width="14px" height="14px"/>
						</a>
					</span>		
				</c:if>			
				<span style="display:${SHOW_EDIT };" class="editField">
					<span style="color:black;padding-right:5px;padding-left:5px;">|</span>
					<a href="javascript:void(0);" onclick="view('${AgricultureAndFoodForm.seq_no }',1);" >
						<img src="${appPath }/resource/image/1322107112_eye_inv.png" border="0" width="14px" height="14px"/>
					</a>
				</span>			
			</td> 			
		</tr>
	</table>
</c:if>

